using System.Data.Objects;
using Microsoft.Practices.Unity;

namespace Common.Unity.Extensions.Entity
{
	public abstract class EntityCreator<EntityType> : EntityCreator
	{
		protected EntityCreator( ObjectContext context ) : base( context )
		{}

		protected virtual void OnCreateEntity( EntityType instance )
		{}

		protected sealed override void OnCreate(object instance)
		{
			OnCreateEntity( (EntityType)instance );
		}
	}
}